.class public Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;
.super Landroid/widget/SimpleCursorAdapter;
.source "CategoryPostListAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;
    }
.end annotation


# static fields
.field public static final DEBUG:Z

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private activity:Landroid/app/Activity;

.field private catChildIndex:I

.field private enableIndex:I

.field private idIndex:I

.field private mInflater:Landroid/view/LayoutInflater;

.field private nameIndex:I

.field private showIndex:I

.field private show_push_enable:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 28
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->DEBUG:Z

    .line 29
    const-class v0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->TAG:Ljava/lang/String;

    .line 25
    return-void
.end method

.method public constructor <init>(Landroid/app/Activity;Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[IZ)V
    .locals 6
    .parameter "activity"
    .parameter "context"
    .parameter "layoutId"
    .parameter "cursor"
    .parameter "columnNames"
    .parameter "columnIds"
    .parameter "show_push_enable"

    .prologue
    .line 45
    move-object v0, p0

    move-object v1, p2

    move v2, p3

    move-object v3, p4

    move-object v4, p5

    move-object v5, p6

    invoke-direct/range {v0 .. v5}, Landroid/widget/SimpleCursorAdapter;-><init>(Landroid/content/Context;ILandroid/database/Cursor;[Ljava/lang/String;[I)V

    .line 48
    invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 49
    iput-boolean p7, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->show_push_enable:Z

    .line 50
    iput-object p1, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->activity:Landroid/app/Activity;

    .line 56
    const-string v0, "id"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->idIndex:I

    .line 57
    const-string v0, "cat_name"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->nameIndex:I

    .line 58
    const-string v0, "cat_enable"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->enableIndex:I

    .line 59
    const-string v0, "cat_child_count"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->catChildIndex:I

    .line 60
    const-string v0, "cat_show_enable"

    invoke-interface {p4, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->showIndex:I

    .line 61
    return-void
.end method

.method static synthetic access$0()Ljava/lang/String;
    .locals 1

    .prologue
    .line 29
    sget-object v0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$1(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;)Landroid/app/Activity;
    .locals 1
    .parameter

    .prologue
    .line 39
    iget-object v0, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->activity:Landroid/app/Activity;

    return-object v0
.end method


# virtual methods
.method public bindView(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V
    .locals 6
    .parameter "view"
    .parameter "context"
    .parameter "cursor"

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x1

    .line 111
    invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;

    .line 113
    .local v1, viewHolder:Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mEnablePushButton:Landroid/widget/CheckBox;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$3(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/CheckBox;

    move-result-object v2

    iget v5, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->nameIndex:I

    invoke-interface {p3, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Landroid/widget/CheckBox;->setText(Ljava/lang/CharSequence;)V

    .line 115
    iget-boolean v2, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->show_push_enable:Z

    if-eqz v2, :cond_1

    .line 116
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mEnablePushButton:Landroid/widget/CheckBox;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$3(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/CheckBox;

    move-result-object v5

    iget v2, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->enableIndex:I

    invoke-interface {p3, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v2

    if-ne v2, v3, :cond_0

    move v2, v3

    :goto_0
    invoke-virtual {v5, v2}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 121
    :goto_1
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mEnablePushButton:Landroid/widget/CheckBox;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$3(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/CheckBox;

    move-result-object v2

    iget v5, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->idIndex:I

    invoke-interface {p3, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Landroid/widget/CheckBox;->setTag(Ljava/lang/Object;)V

    .line 122
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mEnablePushButton:Landroid/widget/CheckBox;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$3(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/CheckBox;

    move-result-object v2

    new-instance v5, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$1;

    invoke-direct {v5, p0}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$1;-><init>(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;)V

    invoke-virtual {v2, v5}, Landroid/widget/CheckBox;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 138
    iget v2, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->catChildIndex:I

    invoke-interface {p3, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    .line 140
    .local v0, cat_child_count:I
    if-lez v0, :cond_3

    .line 141
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenChildren:Landroid/widget/Button;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/Button;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setEnabled(Z)V

    .line 142
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenChildren:Landroid/widget/Button;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/Button;

    move-result-object v2

    iget v3, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->idIndex:I

    invoke-interface {p3, v3}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setTag(Ljava/lang/Object;)V

    .line 143
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenChildren:Landroid/widget/Button;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/Button;

    move-result-object v2

    new-instance v3, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$2;

    invoke-direct {v3, p0}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$2;-><init>(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;)V

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 159
    :goto_2
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenPosts:Landroid/widget/Button;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$5(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/Button;

    move-result-object v2

    iget v3, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->idIndex:I

    invoke-interface {p3, v3}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setTag(Ljava/lang/Object;)V

    .line 160
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenPosts:Landroid/widget/Button;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$5(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/Button;

    move-result-object v2

    new-instance v3, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$3;

    invoke-direct {v3, p0}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$3;-><init>(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;)V

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 171
    return-void

    .end local v0           #cat_child_count:I
    :cond_0
    move v2, v4

    .line 116
    goto :goto_0

    .line 118
    :cond_1
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mEnablePushButton:Landroid/widget/CheckBox;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$3(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/CheckBox;

    move-result-object v5

    iget v2, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->showIndex:I

    invoke-interface {p3, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v2

    if-ne v2, v3, :cond_2

    move v2, v3

    :goto_3
    invoke-virtual {v5, v2}, Landroid/widget/CheckBox;->setChecked(Z)V

    goto :goto_1

    :cond_2
    move v2, v4

    goto :goto_3

    .line 155
    .restart local v0       #cat_child_count:I
    :cond_3
    #getter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenChildren:Landroid/widget/Button;
    invoke-static {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$4(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;)Landroid/widget/Button;

    move-result-object v2

    invoke-virtual {v2, v4}, Landroid/widget/Button;->setEnabled(Z)V

    goto :goto_2
.end method

.method public newView(Landroid/content/Context;Landroid/database/Cursor;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "context"
    .parameter "cursor"
    .parameter "parent"

    .prologue
    .line 84
    iget-object v2, p0, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v3, 0x7f030003

    .line 85
    const/4 v4, 0x0

    .line 84
    invoke-virtual {v2, v3, p3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    .line 88
    .local v0, view:Landroid/view/View;
    new-instance v1, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;

    invoke-direct {v1}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;-><init>()V

    .line 93
    .local v1, viewHolder:Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;
    const v2, 0x7f080014

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/CheckBox;

    #setter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mEnablePushButton:Landroid/widget/CheckBox;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$0(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;Landroid/widget/CheckBox;)V

    .line 94
    const v2, 0x7f080016

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/Button;

    #setter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenChildren:Landroid/widget/Button;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$1(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;Landroid/widget/Button;)V

    .line 95
    const v2, 0x7f080015

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/Button;

    #setter for: Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->mOpenPosts:Landroid/widget/Button;
    invoke-static {v1, v2}, Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;->access$2(Lcom/opongo/blogapp/adapter/CategoryPostListAdapter$ViewHolder;Landroid/widget/Button;)V

    .line 97
    invoke-virtual {v0, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 99
    return-object v0
.end method
